Repository navigation
Conversation
`is_not_semicolon_token` and `is_colon_token` in `utils/eslint_utils/token_predicate.rs` have no caller on main and none in an open pull request. Delete both, and their names in the `pub use` list of `utils/ast_utils.rs`.
|
Status: ready for review This pull request deletes two How to check it:
CI on
Pull request: #47028 |
|
Updated 8:33 PM PT - Oct 26th, 2026
✅ @robobun, your commit 62a1952e174d700bb4b353ba2e8cccd1f241cd67 passed in 🧪 To try this PR locally: bunx bun-pr 47028That installs a local version of the PR into your bun-47028 --bun |
There was a problem hiding this comment.
LGTM — straightforward removal of two unreferenced token predicates.
What was reviewed:
- Repo-wide search (all file types, not just
src/) foris_colon_token,is_not_semicolon_token,isColonToken,isNotSemicolonToken— no remaining references after the deletion. - The nine names left in the
pub use super::eslint_utils::{..}list insrc/lint/utils/ast_utils.rsall still resolve: eight come from thepunctuators!macro andis_not_closing_paren_tokenremains defined, so the re-export and thepub use token_predicate::*glob ineslint_utils/mod.rsare unaffected. is_not_closing_paren_token(kept) still has callers inno_extra_bind.rsandprefer_arrow_callback.rs, so the deletion stops at the right boundary.
Extended reasoning...
The change is a single commit deleting two unused functions from the bun_lint crate: one line removed from the punctuators! macro invocation and one six-line standalone function in src/lint/utils/eslint_utils/token_predicate.rs, plus the matching names dropped from the explicit re-export list in src/lint/utils/ast_utils.rs. It touches no security-sensitive surface and has no runtime behavior change since neither symbol had a caller. A repo-wide grep confirms no reference to either name survives, every remaining re-exported name still exists, and no CODEOWNERS entry covers src/lint. The bug hunt ran dry and no third-party objections are on the timeline, so a human look is not needed.
|
No actionable comments were generated in the recent review.
|
| Layer / File(s) | Summary |
|---|---|
Remove predicates and re-exports src/lint/utils/eslint_utils/token_predicate.rs, src/lint/utils/ast_utils.rs |
Removes is_colon_token and is_not_semicolon_token and removes their re-exports. Other token predicates remain. |
Possibly related PRs
- oven-sh/bun#46832: Removes other unused
bun_lintimplementations, including a conversion inast_utils.rs.
Suggested reviewers: jarred-sumner
Priority:
Merge Risk: 
Minimal · up to c037d
-
No actionable current-head risk is established; the cleanup is ready to merge.
Pre-merge checks: 
4
-
Full details: Title check
-
Explanation
The title "Remove dead code from bun_lint" matches the main change. The diff deletes the unused
is_colon_tokenandis_not_semicolon_tokenpredicates and their re-exports insrc/lint/utils/ast_utils.rs. The title is somewhat broad, since it does not name the two predicates, but it refers to the real change and is not vague or misleading.
Full details: Description check
-
Explanation
The description explains what the PR changes and how the code was verified. It includes the rationale, scope, behavior impact, validation commands, and test results. Although it does not use the exact template headings, it provides the required information in equivalent sections.
-
- Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.
Comment @coderabbitai help to get the list of available commands.
|
No change follows from this review. It confirms the two points that the description states: no reference to either name remains, and the nine names left in the |
Problem
bun_linthave no caller:is_not_semicolon_tokenandis_colon_token(src/lint/utils/eslint_utils/token_predicate.rs).bun lintandbun format#44805. The file holds 11 predicates. The other 9 have callers.Fix
punctuators!line, and both names in thepub uselist ofutils/ast_utils.rs: 10 lines removed, 3 re-wrapped.bun bd,bun run rust:check-all(12 targets),test/cli/lint/defaults.test.ts(Notes).unused_publint (outside this PR).Background
token_predicate.rsmirrorstoken-predicate.mjsof eslint-utils: one small function for each punctuator, for lint rules that ask if a token is;or(.punctuators!expands each line to onepub fnthat callstoken.is_punctuator(text).src/lint/tokens/mod.rs:53documents that call as the equivalent.Downsides
isColonTokenorisNotSemicolonTokenmust writetoken.is_punctuator(":")or restore the function.Behaviour change: none
Notes
Removed
is_not_semicolon_token: the function with its doc comment and#[inline].is_colon_token: its line in thepunctuators!list.pub use super::eslint_utils::{...}ofsrc/lint/utils/ast_utils.rs.git grep -wfor the two names and forisColonTokenandisNotSemicolonTokenfinds only deleted lines.grep -rwoverbuild/debug/codegenfinds nothing.What earlier sweeps said about these items
is_not_semicolon_tokenas a small lead and did not delete it. No sweep namedis_colon_token.src/lint/types, and the trait impls on lint handles, to the owner. This PR touches none of them.Open pull requests
bun lint: experimental native Svelte linting #46518 and Remove dead code from bun_lint, bun_react_compiler, and the node:fs Stats bindings #46832. A trial merge (git merge-tree) shows that this branch adds a conflict to neither.Found dead in this run, and left alone
HTTPHeaderMap::get(const StringView): bun:dom and the Vitest work in one tree (not for merging) #45415,xml/XMLHttpRequestLoader.h:50.JSCommonJSModule::createwith aWTF::Stringkey: Route require() through an overridden Module._load #33026,NodeModuleModule.cpp:818. On main its last callers went away in Hardening: fix crashes across the runtime, bundler, dev server, shell and CLI #46021.JSDOMConvertNumbers.{h,cpp}andIDLTypes.h) andexpectedEnumerationValues: bun:dom and the Vitest work in one tree (not for merging) #45415 usesIDLByte,IDLShort,IDLLongLongand the template.JSC__*exports inbindings.cppthat the linker drops (Remove dead code from the JSC bindings, headers.h, the console builtin, and bun_jsc #40232).StoredTrace::from(Remove dead code from bun_format, bun_install, and bun_core #45402) andposix::s_isdir(Remove dead code from bun_sys, bun_format, boringssl_sys, and two unused Cargo dependencies #46728).generate-string-map.ts(Remove the unused options of generate-string-map.ts #46162).misctools(Remove the Zig-emitting unicode table generator from misctools #41473).struct_Channeldatainc_ares.rs(dns: remove the remaining unsafe from the resolver module #40190).#[css(skip)]of the CSS derives, therustABI ofHOST_EXPORT, andclap::parse_params!(only its own unit test uses it).bun_core::output::pretty_errorln(the macro of the same name is in use). It has no caller on linux, macOS or Windows.completions/bun-cli.json(5137 lines) andmisctools/generate-cli-completions.ts(746 lines). Nothing in the repository reads the JSON. Feature pull requests keep it up to date by hand.How the candidates were found
tools/hawk) for linux-x64 and darwin-arm64, dev profile. Its 44 function, method and type-alias findings outsidebun_windows_syswere deleted in a scratch tree, andcargo check --target x86_64-pc-windows-msvcput 39 back. hawk reports nothing inside a macro expansion, and its Windows run failed.dead_codeonbun_semaandbun_lintin a scratch tree, withpubnarrowed on each item that no dependent crate names. Functions that a macro emits were not judged.-Wl,--gc-sections,--print-gc-sections.tsc --noUnusedLocalsoversrc/js,src,src/runtime/bakeandscripts/build: 19 unused locals. The multi-line ones are removed by Remove dead code from the JSC bindings, the codegen scripts, the CI scripts, bun_core, and bun_jsc #40492 and Remove the dead code from the bake error overlay syntax highlighter #44514.#onConnectinhttp2.tsis a false positive..rsfiles is compiled or is behind acfg. Each of the 766 headers is included or named.Tests, debug build of this branch
test/cli/lint/defaults.test.ts --timeout 90000: 261 pass. With the default 5 s timeout, 46 tests time out in the debug build.no test proof · iteration 1 · the description declares no behaviour change, so there is no failing test to prove; the existing suite in CI is the check